package org.vs.contract;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.DynamicArray;
import org.web3j.abi.datatypes.DynamicStruct;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.StaticStruct;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/web3j/web3j/tree/master/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 1.5.0.
 */
@SuppressWarnings("rawtypes")
public class VoteContract extends Contract {
    public static final String BINARY = "608060405234801561001057600080fd5b50611c23806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ff5760003560e01c80638742fc3b11610097578063cc2ee19611610066578063cc2ee196146101f4578063db424dee14610209578063fdaafa6414610211578063ff3c1a8f14610224576100ff565b80638742fc3b146101bc578063af1de66f146101c4578063c37b24a9146101d7578063c6e48ab0146101df576100ff565b8063703d6d13116100d3578063703d6d131461015f57806372910be0146101745780637b8b01221461018757806382be72651461019c576100ff565b80623259ea1461010457806325dff9d11461012257806347515b8c14610137578063665efb4a1461014c575b600080fd5b61010c610239565b60405161011991906118de565b60405180910390f35b61012a6103c4565b604051610119919061183a565b61014a61014536600461146f565b610604565b005b61014a61015a366004611383565b6106f9565b6101676107a9565b604051610119919061192b565b61014a610182366004611574565b610884565b61018f61089b565b6040516101199190611aa6565b6101af6101aa366004611574565b6108a1565b604051610119919061196b565b61010c6108dd565b61014a6101d2366004611603565b6109b4565b61010c610a1d565b6101e7610b63565b6040516101199190611721565b6101fc610cda565b604051610119919061179f565b6101af610f6b565b61014a61021f3660046115ae565b610f87565b61022c61111b565b6040516101199190611976565b606060006009546001600160401b0381111561026557634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561029e57816020015b61028b6111ee565b8152602001906001900390816102835790505b50905060005b600954811015610310576040805180820182526000838152600860209081529281205482529181019190915282518390839081106102f257634e487b7160e01b600052603260045260246000fd5b6020026020010181905250808061030890611ba6565b9150506102a4565b5060005b600c548110156103be576000818152600b6020526040902080546001909101548351849190811061035557634e487b7160e01b600052603260045260246000fd5b60200260200101516020015161036b9190611b07565b6000828152600b60205260409020600101548351849190811061039e57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101510152806103b681611ba6565b915050610314565b50905090565b60408051600180825281830190925260609160009190816020015b6103e7611208565b8152602001906001900390816103df57905050905060006040518060a001604052908160008201805461041990611b4f565b80601f016020809104026020016040519081016040528092919081815260200182805461044590611b4f565b80156104925780601f1061046757610100808354040283529160200191610492565b820191906000526020600020905b81548152906001019060200180831161047557829003601f168201915b505050505081526020016001820180546104ab90611b4f565b80601f01602080910402602001604051908101604052809291908181526020018280546104d790611b4f565b80156105245780601f106104f957610100808354040283529160200191610524565b820191906000526020600020905b81548152906001019060200180831161050757829003601f168201915b5050505050815260200160028201805461053d90611b4f565b80601f016020809104026020016040519081016040528092919081815260200182805461056990611b4f565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050815260200160038201548152602001600482015481525050816000815181106105f457634e487b7160e01b600052603260045260246000fd5b6020908102919091010152905090565b6009541561062d5760405162461bcd60e51b815260040161062490611a55565b60405180910390fd5b60005b81518161ffff1610156106f2576000828261ffff168151811061066357634e487b7160e01b600052603260045260246000fd5b60209081029190910181015161ffff84166000908152600883526040902081518155818301518051929450849391926106a29260018501920190611237565b50604082015180516106be916002840191602090910190611237565b50606082015180516106da916003840191602090910190611237565b509050505080806106ea90611b84565b915050610630565b5051600955565b600654156107195760405162461bcd60e51b815260040161062490611a70565b60005b81518110156107a257600082828151811061074757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516000848152600583526040902081518155818301518051929450849391926107819260018501920190611237565b5060409190910151600290910155508061079a81611ba6565b91505061071c565b5051600655565b60606000600c546001600160401b038111156107d557634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561080e57816020015b6107fb6111ee565b8152602001906001900390816107f35790505b50905060005b600c548110156103be576000818152600b60209081526040918290208251808401909352805483526001015490820152825183908390811061086657634e487b7160e01b600052603260045260246000fd5b6020026020010181905250808061087c90611ba6565b915050610814565b8051610897906000906020840190611237565b5050565b60095490565b6000806007836040516108b49190611705565b90815260200160405180910390205490506001915080600014156108d757600091505b50919050565b606060006009546001600160401b0381111561090957634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561094257816020015b61092f6111ee565b8152602001906001900390816109275790505b50905060005b6009548110156103be5760408051808201825260008381526008602090815292812054825291810191909152825183908390811061099657634e487b7160e01b600052603260045260246000fd5b602002602001018190525080806109ac90611ba6565b915050610948565b8051805182916000916109ce918391602090910190611237565b5060208281015180516109e79260018501920190611237565b5060408201518051610a03916002840191602090910190611237565b506060820151600382015560809091015160049091015550565b606060006009546001600160401b03811115610a4957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610a8257816020015b610a6f6111ee565b815260200190600190039081610a675790505b50905060005b600954811015610af457604080518082018252600083815260086020908152928120548252918101919091528251839083908110610ad657634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080610aec90611ba6565b915050610a88565b5060008052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f7754815160019183918110610b4357634e487b7160e01b600052603260045260246000fd5b6020026020010151602001818151610b5b9190611b07565b905250905090565b606060006006546001600160401b03811115610b8f57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610bc857816020015b610bb56112bb565b815260200190600190039081610bad5790505b50905060005b6006548110156103be576005600082815260200190815260200160002060405180606001604052908160008201548152602001600182018054610c1090611b4f565b80601f0160208091040260200160405190810160405280929190818152602001828054610c3c90611b4f565b8015610c895780601f10610c5e57610100808354040283529160200191610c89565b820191906000526020600020905b815481529060010190602001808311610c6c57829003601f168201915b50505050508152602001600282015481525050828281518110610cbc57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080610cd290611ba6565b915050610bce565b606060006009546001600160401b03811115610d0657634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610d3f57816020015b610d2c6112dc565b815260200190600190039081610d245790505b50905060005b6009548110156103be576008600082815260200190815260200160002060405180608001604052908160008201548152602001600182018054610d8790611b4f565b80601f0160208091040260200160405190810160405280929190818152602001828054610db390611b4f565b8015610e005780601f10610dd557610100808354040283529160200191610e00565b820191906000526020600020905b815481529060010190602001808311610de357829003601f168201915b50505050508152602001600282018054610e1990611b4f565b80601f0160208091040260200160405190810160405280929190818152602001828054610e4590611b4f565b8015610e925780601f10610e6757610100808354040283529160200191610e92565b820191906000526020600020905b815481529060010190602001808311610e7557829003601f168201915b50505050508152602001600382018054610eab90611b4f565b80601f0160208091040260200160405190810160405280929190818152602001828054610ed790611b4f565b8015610f245780601f10610ef957610100808354040283529160200191610f24565b820191906000526020600020905b815481529060010190602001808311610f0757829003601f168201915b505050505081525050828281518110610f4d57634e487b7160e01b600052603260045260246000fd5b60200260200101819052508080610f6390611ba6565b915050610d45565b6003546000904210801590610f8257506004544211155b905090565b610f8f610f6b565b610fab5760405162461bcd60e51b815260040161062490611a8b565b610fb4816111af565b610fd05760405162461bcd60e51b815260040161062490611a3a565b60008060005b6006548110156110925784604051602001610ff19190611976565b60408051601f198184030181528282528051602091820120600085815260058352929092209192611026926001019101611990565b6040516020818303038152906040528051906020012014156110805760006007866040516110549190611705565b908152602001604051809103902081905550600560008281526020019081526020016000206002015492505b8061108a81611ba6565b915050610fd6565b5060005b6009548110156110d05760008181526008602052604090205461ffff851614156110be578091505b806110c881611ba6565b915050611096565b506040805180820182528381526020808201848152600c80546000908152600b90935293909120825181559051600191820155915490916111119190611b07565b600c555050505050565b606060008001805461112c90611b4f565b80601f016020809104026020016040519081016040528092919081815260200182805461115890611b4f565b80156111a55780601f1061117a576101008083540402835291602001916111a5565b820191906000526020600020905b81548152906001019060200180831161118857829003601f168201915b5050505050905090565b6000805b6009548110156108d75760008181526008602052604090205461ffff841614156111dc57600191505b806111e681611ba6565b9150506111b3565b604051806040016040528060008152602001600081525090565b6040518060a0016040528060608152602001606081526020016060815260200160008152602001600081525090565b82805461124390611b4f565b90600052602060002090601f01602090048101928261126557600085556112ab565b82601f1061127e57805160ff19168380011785556112ab565b828001600101855582156112ab579182015b828111156112ab578251825591602001919060010190611290565b506112b7929150611304565b5090565b60405180606001604052806000815260200160608152602001600081525090565b6040518060800160405280600081526020016060815260200160608152602001606081525090565b5b808211156112b75760008155600101611305565b600082601f830112611329578081fd5b81356001600160401b0381111561134257611342611bd7565b611355601f8201601f1916602001611aaf565b818152846020838601011115611369578283fd5b816020850160208301379081016020019190915292915050565b60006020808385031215611395578182fd5b82356001600160401b03808211156113ab578384fd5b818501915085601f8301126113be578384fd5b81356113d16113cc82611ad8565b611aaf565b81815284810190848601875b8481101561146057813587016060818d03601f190112156113fc57898afd5b60408051606081018181108a8211171561141857611418611bd7565b8252828b013581528282013589811115611430578c8dfd5b61143e8f8d83870101611319565b828d0152506060929092013590820152845292870192908701906001016113dd565b50909998505050505050505050565b60006020808385031215611481578182fd5b82356001600160401b0380821115611497578384fd5b818501915085601f8301126114aa578384fd5b81356114b86113cc82611ad8565b81815284810190848601875b848110156114605781358701608080601f19838f030112156114e4578a8bfd5b6114ed81611aaf565b8a8301358152604083013589811115611504578c8dfd5b6115128f8d83870101611319565b8c83015250606083013589811115611528578c8dfd5b6115368f8d83870101611319565b60408301525090820135908882111561154d578b8cfd5b61155b8e8c84860101611319565b60608201528652505092870192908701906001016114c4565b600060208284031215611585578081fd5b81356001600160401b0381111561159a578182fd5b6115a684828501611319565b949350505050565b600080604083850312156115c0578081fd5b82356001600160401b038111156115d5578182fd5b6115e185828601611319565b925050602083013561ffff811681146115f8578182fd5b809150509250929050565b600060208284031215611614578081fd5b81356001600160401b038082111561162a578283fd5b9083019060a0828603121561163d578283fd5b61164760a0611aaf565b823582811115611655578485fd5b61166187828601611319565b825250602083013582811115611675578485fd5b61168187828601611319565b602083015250604083013582811115611698578485fd5b6116a487828601611319565b604083015250606083013560608201526080830135608082015280935050505092915050565b600081518084526116e2816020860160208601611b1f565b601f01601f19169290920160200192915050565b80518252602090810151910152565b60008251611717818460208701611b1f565b9190910192915050565b60208082528251828201819052600091906040908185019080840286018301878501865b8381101561179157603f19898403018552815160608151855288820151818a870152611773828701826116ca565b92890151958901959095525094870194925090860190600101611745565b509098975050505050505050565b60208082528251828201819052600091906040908185019080840286018301878501865b8381101561179157603f19898403018552815160808151855288820151818a8701526117f1828701826116ca565b915050878201518582038987015261180982826116ca565b9150506060808301519250858203818701525061182681836116ca565b9689019694505050908601906001016117c3565b60208082528251828201819052600091906040908185019080840286018301878501865b8381101561179157603f19898403018552815160a08151818652611884828701826116ca565b915050888201518582038a87015261189c82826116ca565b91505087820151858203898701526118b482826116ca565b6060848101519088015260809384015193909601929092525050938601939086019060010161185e565b602080825282518282018190526000919060409081850190868401855b8281101561191e5761190e8483516116f6565b92840192908501906001016118fb565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b8281101561191e5761195b8483516116f6565b9284019290850190600101611948565b901515815260200190565b60006020825261198960208301846116ca565b9392505050565b60006020808352818454836002820490506001808316806119b257607f831692505b8583108114156119d057634e487b7160e01b87526022600452602487fd5b6119dc83878a01611aa6565b8180156119f05760018114611a0157611a2b565b60ff19861682528782019650611a2b565b611a0a8b611afb565b895b86811015611a2557815484820152908501908901611a0c565b83019750505b50949998505050505050505050565b6020808252600190820152600d60fa1b604082015260600190565b6020808252600190820152601960f91b604082015260600190565b6020808252600190820152603160f81b604082015260600190565b6020808252600190820152603560f81b604082015260600190565b90815260200190565b6040518181016001600160401b0381118282101715611ad057611ad0611bd7565b604052919050565b60006001600160401b03821115611af157611af1611bd7565b5060209081020190565b60009081526020902090565b60008219821115611b1a57611b1a611bc1565b500190565b60005b83811015611b3a578181015183820152602001611b22565b83811115611b49576000848401525b50505050565b600281046001821680611b6357607f821691505b602082108114156108d757634e487b7160e01b600052602260045260246000fd5b600061ffff80831681811415611b9c57611b9c611bc1565b6001019392505050565b6000600019821415611bba57611bba611bc1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea26469706673582212208205be76786aad70fd30d0e0a1ff7843f88eff23efb417030c5cd75a2507d7ab64736f6c63430008000033";

    public static final String FUNC_GETELECTORS = "getElectors";

    public static final String FUNC_GETOPTIONLENGTH = "getOptionLength";

    public static final String FUNC_GETOPTIONS = "getOptions";

    public static final String FUNC_GETTITLE = "getTitle";

    public static final String FUNC_GETVOTEINFO = "getVoteInfo";

    public static final String FUNC_GETVOTERESULT = "getVoteResult";

    public static final String FUNC_GETVOTERESULT1 = "getVoteResult1";

    public static final String FUNC_GETVOTEDS = "getVoteds";

    public static final String FUNC_SETELECTOR = "setElector";

    public static final String FUNC_SETOPTIONS = "setOptions";

    public static final String FUNC_SETTITLE = "setTitle";

    public static final String FUNC_SETVOTEINFO = "setVoteInfo";

    public static final String FUNC_VERIFYHAVEVOTED = "verifyHaveVoted";

    public static final String FUNC_VERIFYLEGALTIME = "verifyLegalTime";

    public static final String FUNC_VOTE = "vote";

    public static final String FUNC_VOTERESULT = "voteResult";

    @Deprecated
    protected VoteContract(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected VoteContract(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected VoteContract(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected VoteContract(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public RemoteFunctionCall<List> getElectors() {
        final Function function = new Function(FUNC_GETELECTORS, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Elector>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<BigInteger> getOptionLength() {
        final Function function = new Function(FUNC_GETOPTIONLENGTH, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<List> getOptions() {
        final Function function = new Function(FUNC_GETOPTIONS, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Option>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<String> getTitle() {
        final Function function = new Function(FUNC_GETTITLE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<List> getVoteInfo() {
        final Function function = new Function(FUNC_GETVOTEINFO, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<VoteInfo>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<List> getVoteResult() {
        final Function function = new Function(FUNC_GETVOTERESULT, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<VoteResultVo>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<List> getVoteResult1() {
        final Function function = new Function(FUNC_GETVOTERESULT1, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<VoteResultVo>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<List> getVoteds() {
        final Function function = new Function(FUNC_GETVOTEDS, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Voted>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<TransactionReceipt> setElector(List<Elector> _electors) {
        final Function function = new Function(
                FUNC_SETELECTOR, 
                Arrays.<Type>asList(new DynamicArray<Elector>(Elector.class, _electors)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setOptions(List<Option> _options) {
        final Function function = new Function(
                FUNC_SETOPTIONS, 
                Arrays.<Type>asList(new DynamicArray<Option>(Option.class, _options)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setTitle(String _title) {
        final Function function = new Function(
                FUNC_SETTITLE, 
                Arrays.<Type>asList(new Utf8String(_title)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setVoteInfo(VoteInfo _voteInfo) {
        final Function function = new Function(
                FUNC_SETVOTEINFO, 
                Arrays.<Type>asList(_voteInfo), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Boolean> verifyHaveVoted(String sign) {
        final Function function = new Function(FUNC_VERIFYHAVEVOTED, 
                Arrays.<Type>asList(new Utf8String(sign)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<Boolean> verifyLegalTime() {
        final Function function = new Function(FUNC_VERIFYLEGALTIME, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<TransactionReceipt> vote(String sign, BigInteger optionId) {
        final Function function = new Function(
                FUNC_VOTE, 
                Arrays.<Type>asList(new Utf8String(sign),
                new org.web3j.abi.datatypes.generated.Uint16(optionId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<List> voteResult() {
        final Function function = new Function(FUNC_VOTERESULT, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<VoteResultVo>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    @Deprecated
    public static VoteContract load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new VoteContract(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static VoteContract load(String contractAddress, Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new VoteContract(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static VoteContract load(String contractAddress, Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return new VoteContract(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static VoteContract load(String contractAddress, Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new VoteContract(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<VoteContract> deploy(Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(VoteContract.class, web3j, credentials, contractGasProvider, BINARY, "");
    }

    @Deprecated
    public static RemoteCall<VoteContract> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(VoteContract.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
    }

    public static RemoteCall<VoteContract> deploy(Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(VoteContract.class, web3j, transactionManager, contractGasProvider, BINARY, "");
    }

    @Deprecated
    public static RemoteCall<VoteContract> deploy(Web3j web3j, TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(VoteContract.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
    }

    public static class Elector extends DynamicStruct {
        public BigInteger id;

        public String sign;

        public BigInteger weight;

        public Elector(BigInteger id, String sign, BigInteger weight) {
            super(new Uint256(id),
                    new Utf8String(sign),
                    new Uint256(weight));
            this.id = id;
            this.sign = sign;
            this.weight = weight;
        }

        public Elector(Uint256 id, Utf8String sign, Uint256 weight) {
            super(id, sign, weight);
            this.id = id.getValue();
            this.sign = sign.getValue();
            this.weight = weight.getValue();
        }
    }

    public static class Option extends DynamicStruct {
        public BigInteger id;

        public String name;

        public String image;

        public String describe;

        public Option(BigInteger id, String name, String image, String describe) {
            super(new Uint256(id),
                    new Utf8String(name),
                    new Utf8String(image),
                    new Utf8String(describe));
            this.id = id;
            this.name = name;
            this.image = image;
            this.describe = describe;
        }

        public Option(Uint256 id, Utf8String name, Utf8String image, Utf8String describe) {
            super(id, name, image, describe);
            this.id = id.getValue();
            this.name = name.getValue();
            this.image = image.getValue();
            this.describe = describe.getValue();
        }
    }

    public static class VoteInfo extends DynamicStruct {
        public String title;

        public String image;

        public String describe;

        public BigInteger startTime;

        public BigInteger endTime;

        public VoteInfo(String title, String image, String describe, BigInteger startTime, BigInteger endTime) {
            super(new Utf8String(title),
                    new Utf8String(image),
                    new Utf8String(describe),
                    new Uint256(startTime),
                    new Uint256(endTime));
            this.title = title;
            this.image = image;
            this.describe = describe;
            this.startTime = startTime;
            this.endTime = endTime;
        }

        public VoteInfo(Utf8String title, Utf8String image, Utf8String describe, Uint256 startTime, Uint256 endTime) {
            super(title, image, describe, startTime, endTime);
            this.title = title.getValue();
            this.image = image.getValue();
            this.describe = describe.getValue();
            this.startTime = startTime.getValue();
            this.endTime = endTime.getValue();
        }
    }

    public static class VoteResultVo extends StaticStruct {
        public BigInteger id;

        public BigInteger votes;

        public VoteResultVo(BigInteger id, BigInteger votes) {
            super(new Uint256(id),
                    new Uint256(votes));
            this.id = id;
            this.votes = votes;
        }

        public VoteResultVo(Uint256 id, Uint256 votes) {
            super(id, votes);
            this.id = id.getValue();
            this.votes = votes.getValue();
        }
    }

    public static class Voted extends StaticStruct {
        public BigInteger weight;

        public BigInteger optionId;

        public Voted(BigInteger weight, BigInteger optionId) {
            super(new Uint256(weight),
                    new Uint256(optionId));
            this.weight = weight;
            this.optionId = optionId;
        }

        public Voted(Uint256 weight, Uint256 optionId) {
            super(weight, optionId);
            this.weight = weight.getValue();
            this.optionId = optionId.getValue();
        }
    }
}
